package com.xpqh.ksg.exception;

import com.xpqh.ksg.common.enums.result.BizExceptionEnum;
import lombok.Data;

/**
 * 封装异常
 *
 * @author lizhihui
 * @date 2025.03.21
 */
@Data
public class WebApiException extends RuntimeException {

    /** */
	private static final long serialVersionUID = 1L;

	private Integer code;

    private String message;

    public WebApiException(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public WebApiException(BizExceptionEnum bizExceptionEnum) {
        this.code = bizExceptionEnum.getCode();
        this.message = bizExceptionEnum.getMessage();
    }

}
